1 #ifndef ADMIN_H
2 #define ADMIN_H
3
4 #include<fstream>
5 #include
"teacher.h"
6 #include
"student.h"
7 #include<iostream>

8
9 using
namespace std;
10 class
admin
11 {

12 public
:
13   
void addstudent()
14   {
15     ofstream fout;
16     student S;
17     fout.open(
"student.dat",ios::in|ios::app);
18
19     cout<<
"\n\nEnter the details of the student to be added: ";
20     S.input();
21     fout.write((
char*)&S, sizeof(S));
22     cout<<
"\n\nThe student is added";
23
24     fout.close();
25   }
26
27   
void addteacher()
28   {
29     ofstream fout;
30     teacher T;
31     fout.open(
"teacher.dat",ios::in|ios::app);
32
33     cout<<
"\n\nEnter the details of the teacher to be added: ";
34     T.input();
35     fout.write((
char*)&T, sizeof(T));
36     cout<<
"\n\nThe teacher is added";
37
38     fout.close();
39   }
40 };
41
42 #endif


Gõ tìm kiếm nhanh...